
using System;
using System.Web;
using System.Web.UI;


namespace webpman
{
	
	
	public partial class @modify : System.Web.UI.Page
	{
		
		protected void Page_Load(object sender, EventArgs e)
        {
			
			
			// Manager for generic objects, settings, languages and skins
			General GeneralClass = new General();
						
			// Update current webpage with right settings
			Page MyPage = this;
			GeneralClass.SetEnvironment(ref MyPage);
			this.Page = MyPage;
			
			// Init DB and set GeneralClass Object on Master Page
			GeneralClass.DBOpen();
			((master1)this.Master).MasterGeneral = GeneralClass;
			
			
			// Code....
			string EntityManaged;
			if (Request.QueryString["object"] == null)
				EntityManaged = "project";
			else
				EntityManaged = Request.QueryString["object"].ToString();

			
			
			// Update Page
			if (Session["USER"] != null)
			{
				if (Request.Form["TABLENAME"] == null)
				{
					// Get Edit table
					resultdiv.InnerHtml = GeneralClass.DBEditTable(EntityManaged,
					                                               Session["USER"].ToString(),
					                                               Session["AUTH"].ToString(),
					                                               Request.QueryString);				
				}
				else
				{
					// Update table (insert/update)
					resultdiv.InnerHtml = GeneralClass.DBUpdateTable(EntityManaged,
					                                                 Session["USER"].ToString(),
					                                                 Session["AUTH"].ToString(),
					                                                 Request.Form);	
				}
										
			}

			
			
        }
	}
}
